
 //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "DPCnsRcD.h"
#include "DPGrfRcD.h"
#include "RLCnsRcD.h"
#include "DModule.h"
#include "stdm.h"

//---------------------------------------------------------------------------
#pragma package( smart_init )
#pragma link "DialPad"
#pragma link "PHDS"
#pragma link "PHEdit"
#pragma link "PHLabel"
#pragma link "PHGridEd"
#pragma link "DIALPAD"
#pragma resource "*.dfm"
TDPCnsRcD1 * DPCnsRcD1;

//---------------------------------------------------------------------------
__fastcall TDPCnsRcD1::TDPCnsRcD1( TComponent*  Owner ) : TDiPad( Owner )
{
  PHDS1->Tabela = DM->TBGeral;
  DSRcDs->Tabela = DM->TBRcDesp;
}

//---------------------------------------------------------------------------
void __fastcall TDPCnsRcD1::BitBtn4Click( TObject*  Sender )
{
  try
   {
    DPGrfRcD1 = new TDPGrfRcD1( NULL );
    DPGrfRcD1->ShowModal();
   }

  __finally
   {
    delete DPGrfRcD1;
   }

}

//---------------------------------------------------------------------------
void __fastcall TDPCnsRcD1::BitBtn3Click( TObject*  Sender )
{
  TPedeRel1*  PR;
  TRLCnsRcD1*  RLCnsRcD1 = new TRLCnsRcD1( NULL );
  try
   {
    PR = new TPedeRel1( NULL );
    PR->Report = RLCnsRcD1->PHReport1;
    PR->ShowModal();
   }

  __finally
   {
    Close();
    delete RLCnsRcD1;
    delete PR;
   }

}

//---------------------------------------------------------------------------
void __fastcall TDPCnsRcD1::DSRcDsAfterOpen( TObject*  Sender )
{
  Rd = ( struct RCDESP* ) DSRcDs->Buffer;
}

//---------------------------------------------------------------------------
void __fastcall TDPCnsRcD1::BitBtn1Click( TObject*  Sender )
{
  if( DPA->DPCnsRcDDataInical > DPA->DPCnsRcDDataFinal )
   {
    throw Exception( "'Data Inicial' deve ser menor que 'Data Final'." );
   }
}

//---------------------------------------------------------------------------

